import IndexRouter from "./router/indexRouter";
import { Provider } from "react-redux";
import { store, persistor } from "./redux/store";
import { PersistGate } from "redux-persist/integration/react";
import "./App.css";
import { jsonServer } from "./util/type";
import { useEffect } from "react";
import "./api";
// import "antd/dist/reset.css";
function App() {
  useEffect(() => {
    jsonServer().then((res) => {
      console.log(res);
    });
  }, []);
  return (
    <Provider store={store}>
      {/* react-persist持久化--->管理redux的 */}
      <PersistGate loading={null} persistor={persistor}>
        <IndexRouter></IndexRouter>
      </PersistGate>
    </Provider>
  );
}

export default App;
